<html>
  <head>
    <title>Area Anchor</title>
    <script type="text/javascript" src="../../protovis.js"></script>
  </head>
  <body>
    <script type="text/javascript+protovis">

var data = pv.range(10).map(function(x) ({x: x, y: Math.sin(x) + 2})),
    w = 400,
    h = 50,
    x = pv.Scale.linear(data, function(d) d.x).range(0, w),
    y = pv.Scale.linear(0, 3).range(0, h);

var vis = new pv.Panel()
    .width(w)
    .height(h)
    .margin(10);

vis.add(pv.Area)
    .data(data)
    .bottom(0)
    .left(function(d) x(d.x))
    .height(function(d) y(d.y))
  .anchor().add(pv.Area)
    .height(function() this.scene.target[this.index].height)
    .strokeStyle("black");

vis.render();

    </script>
  </body>
</html>
